import java.util.Scanner;

public class demo02 {
    //倒置字符串
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        String str=sc.nextLine();
        char[] arr=str.toCharArray();
        int left=0;
        int right=arr.length-1;
        swap1(arr,left,right);
        swap2(arr);
        String str1=new String(arr);
        System.out.println(str1);
    }
    public static void swap2(char[] arr){
        int i=0;
        int j=0;
        while (i<arr.length-1&&j<arr.length-1){
            while (arr[j+1]!=' '&&j<arr.length-2){
                j++;
            }
            if(j>=arr.length-2){
                break;
            }
            swap1(arr,i,j);
            i=j+2;
            j+=2;
        }
        swap1(arr,i,arr.length-1);
    }
    public static void swap1(char[] arr,int left,int right){
        while (left<right){
            char tmp=arr[left];
            arr[left]=arr[right];
            arr[right]=tmp;
            left++;
            right--;
        }
    }
}
